﻿// || - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ||
// || euzo.ca                                                                         | 2153735 Ontario Ltd. | Mississauga, Ontario, CANADA ||
// || - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ||

#region Implemented Namespaces

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Runtime.InteropServices;
using System.IO;
using System.Xml;
using System.Xml.XPath;
using System.Xml.Xsl;

using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.Shell;
using OLE = Microsoft.VisualStudio.OLE.Interop;
using System.Reflection;
using System.Configuration.Install;
using System.Collections;

#endregion

namespace EuzoCa.CodeGenerator
{
    /// <summary>
    /// This class is called from the installer, it registers or un-registers the tool to/off COM.
    /// </summary>
    [RunInstaller(true)]
    public partial class CodeGeneratorInstaller : Installer
    {
        /// <summary>
        ///  The class constructor.
        /// </summary>
        public CodeGeneratorInstaller()
        {
            InitializeComponent();
        }       

        /// <summary>
        /// Register the class, called on install.
        /// </summary>
        /// <param name="stateSaver">A IDictionary that represents the current state of the installation.
        /// </param>
        public override void Install(IDictionary stateSaver)
        {
            base.Install(stateSaver);

            Assembly objAsm = Assembly.GetAssembly(typeof(CodeGenerator));
            RegistrationServices objRS = new RegistrationServices();
            objRS.RegisterAssembly(objAsm, AssemblyRegistrationFlags.SetCodeBase);
        }

        /// <summary>
        /// Un-register the class, called on the uninstall.
        /// </summary>
        /// <param name="stateSaver">A IDictionary that represents the current state of the installation.
        /// </param>
        public override void Uninstall(IDictionary savedState)
        {
            base.Uninstall(savedState);

            Assembly objAsm = Assembly.GetAssembly(typeof(CodeGenerator));
            RegistrationServices objRS = new RegistrationServices();
            objRS.UnregisterAssembly(objAsm);
        }
    }
}
